<a href="?act=edit_tour&add=1"><img src="images/add_new.gif">Thêm tour</img></a>
<table class="tb_table" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="tb_head">
	<td>Thứ tự</td>
    <td>Tên Tours</td>
    <td>Khởi hành</td>
    <td>Kết Thúc</td>
	<td>Giá tour</td>
    <td>Giảm giá</td>
	<td>Thư viện ảnh</td>
	<td>Địa điểm</td>
	<td>Hiệu lực</td>
	<td>Thao tác</td>
  </tr>
	<?php 
		$cnt = 0;
		foreach ($tours as $tour) {
			$cnt ++;
	?>
  		<tr class="tb_content">
			<td><?php echo $cnt ?></td>
			<td><?php echo $tour->getname() ?></td>
			<td><?php echo $tour->getstart_date() ?></td>
			<td><?php echo $tour->getend_date() ?></td>
			<?php $currency = $tour->getCurrencyObj() ?>
			<td><?php echo $tour->getprice().' '.($currency ? $currency->getcurrency_code() : "")?></td>
            <td><?php echo $tour->getPromotion();?> %</td>
			<td><a href="?act=pictures_list&tour_id=<?php echo $tour->getid()?>"><img src="/admin/images/edit.gif"></a></td>
			<td><a href="?act=locations_list_for_tour&tour_id=<?php echo $tour->getid()?>"><img src="/admin/images/edit.gif"></a></td>
			<td><?php echo $tour->getactive() == 1 ? 'Có' : 'Không'?></td>
			<td><a href="?act=edit_tour&tour_id=<?php echo $tour->getid() ?>">Sửa</a>/<a href="" onclick="return ask_to_delete('action.php?act=delete_tour&tour_id=<?php echo $tour->getid()?>')">Xóa</a></td>
  		</tr>
	<?php } ?>
</table>
<a href="?act=edit_tour&add=1"><img src="images/add_new.gif">Thêm Tour</img></a>
<div id="aks_dialog" hidden="hidden">
	<h2>Bạn có chắc muốn xóa tour này ?</h2>
</div>

<?php
	echo "<div style='padding-top:10px;'>";
	if (isset($active) && $active == 0)
		echo "<a href='?act=tours_manager'><img src='images/active.png' align='left'><div style='float:left;padding-top:10px;padding-left:5px;'>Danh sách khách sạn đang hoạt động</div></a>";
	else
		echo "<a href='?act=tours_manager&active=0'><img src='images/inactive.png' align='left' ><div style='float:left;padding-top:10px;padding-left:5px;'>Danh sách khách sạn đã tạm xóa</div></a>";
	echo "<div style='clear:both'></div>";
	echo "</div>";
?>
<script type="text/javascript">
	function ask_to_delete(link)
	{
		$('#aks_dialog').dialog(
		{
			buttons: { 
				"Yes": function() {$.get(link); $(this).dialog("close");},
				"No": function() {$(this).dialog("close");}
			},
			close: function(event, ui) {window.location.reload();}
		});
		return false;
	}
</script>